<template lang="html">
  <div class="all-cont">
    <el-table
    :data="allData"
    border
    style="width: 100%">
      <el-table-column prop="name" label="公告名称">
      </el-table-column>
      <el-table-column prop="afficheType" label="公告类型">
      </el-table-column>
      <el-table-column prop="afficheDate" label="刊登日期">
      </el-table-column>
      <el-table-column prop="affiche" label="公告人">
      </el-table-column>
      <el-table-column label="操作" width='120'>
        <template scope="scope">
          <el-button type="text">
            <i class="glyphicon glyphicon-edit el-button--text"></i>
          </el-button>
          <el-button type="text" @click="deleteInvestment(scope.row.id)">
            <i class="glyphicon glyphicon-delete"></i>
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ['allData', 'type'],
  methods: {
    deleteInvestment (id) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$http('delete', this.type, {params: {id: id}})
        .then((data) => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          })
        })
      }).catch(() => {
      })
    }
  }
}
</script>

<style lang="css">
</style>
